package dto

import (
	"tuowei.com/app/admin/models"
	"tuowei.com/common/dto"
)

type SysVersionListReq struct {
	dto.Pagination
}

type SysVersionInsertReq struct {
	Id                   int    `json:"id"`
	Status               string `json:"status" binding:"oneof=success fail"`
	Msg                  string `json:"msg"`
	VersionAndroid       string `json:"version_android"`
	VersionIos           string `json:"version_ios"`
	VersionIosDifference string `json:"version_ios_difference"`
	Android              string `json:"android"`
	Ios                  string `json:"ios"`
	DifferenceURLAndroid string `json:"difference_url_android"`
	DifferenceURLIos     string `json:"difference_url_ios"`
	Platform             string `json:"platform" binding:"required"`
}

func (v *SysVersionInsertReq) Generate(model *models.SysVersion) {
	if v.Id > 0 {
		model.Id = v.Id
	}
	model.Status = v.Status
	model.Msg = v.Msg
	model.VersionAndroid = v.VersionAndroid
	model.VersionIos = v.VersionIos
	model.VersionIosDifference = v.VersionIosDifference
	model.Android = v.Android
	model.Ios = v.Ios
	model.DifferenceURLAndroid = v.DifferenceURLAndroid
	model.DifferenceURLIos = v.DifferenceURLIos
	model.Platform = v.Platform
}
